package com.broad.school_description.kafka;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

import java.util.function.Consumer;

//@Component(value = "kafkaConsumer")
public class KafkaConsumer {
    @KafkaListener(topics = {"test"},groupId = "springboottopic-group2")
    public void onMessage1(ConsumerRecord<?,?> record){
        System.out.println("1简单消费"+record.topic()+record.partition()+record.value());
    }
    @KafkaListener(topics = {"test"},groupId = "springboottopic-group")
    public void onMessage2(ConsumerRecord<?,?> record){
        System.out.println("2简单消费"+record.topic()+record.partition()+record.value());
    }

}
